set_source_files_properties(
    mul_Ascend910B1_float16_210000000.cce
    mul_Ascend910B1_float16_210010000.cce
    mul_Ascend910B1_float16_223000000.cce
    mul_Ascend910B1_float16_223010000.cce
    mul_Ascend910B1_float16_232000000.cce
    mul_Ascend910B1_float16_232010000.cce
    mul_Ascend910B1_float32_210000000.cce
    mul_Ascend910B1_float32_210010000.cce
    mul_Ascend910B1_float32_223000000.cce
    mul_Ascend910B1_float32_223010000.cce
    mul_Ascend910B1_float32_232000000.cce
    mul_Ascend910B1_float32_232010000.cce
    mul_Ascend910B1_int8_210000000.cce
    mul_Ascend910B1_int8_210010000.cce
    mul_Ascend910B1_int8_223000000.cce
    mul_Ascend910B1_int8_223010000.cce
    mul_Ascend910B1_int8_232000000.cce
    mul_Ascend910B1_int8_232010000.cce
    mul_Ascend910B1_int32_210000000.cce
    mul_Ascend910B1_int32_210010000.cce
    mul_Ascend910B1_int32_223000000.cce
    mul_Ascend910B1_int32_223010000.cce
    mul_Ascend910B1_int32_232000000.cce
    mul_Ascend910B1_int32_232010000.cce
    mul_Ascend910B2_float16_210000000.cce
    mul_Ascend910B2_float16_210010000.cce
    mul_Ascend910B2_float16_223000000.cce
    mul_Ascend910B2_float16_223010000.cce
    mul_Ascend910B2_float16_232000000.cce
    mul_Ascend910B2_float16_232010000.cce
    mul_Ascend910B2_float32_210000000.cce
    mul_Ascend910B2_float32_210010000.cce
    mul_Ascend910B2_float32_223000000.cce
    mul_Ascend910B2_float32_223010000.cce
    mul_Ascend910B2_float32_232000000.cce
    mul_Ascend910B2_float32_232010000.cce
    mul_Ascend910B2_int8_210000000.cce
    mul_Ascend910B2_int8_210010000.cce
    mul_Ascend910B2_int8_223000000.cce
    mul_Ascend910B2_int8_223010000.cce
    mul_Ascend910B2_int8_232000000.cce
    mul_Ascend910B2_int8_232010000.cce
    mul_Ascend910B2_int32_210000000.cce
    mul_Ascend910B2_int32_210010000.cce
    mul_Ascend910B2_int32_223000000.cce
    mul_Ascend910B2_int32_223010000.cce
    mul_Ascend910B2_int32_232000000.cce
    mul_Ascend910B2_int32_232010000.cce
    mul_Ascend910B3_float16_210000000.cce
    mul_Ascend910B3_float16_210010000.cce
    mul_Ascend910B3_float16_223000000.cce
    mul_Ascend910B3_float16_223010000.cce
    mul_Ascend910B3_float16_232000000.cce
    mul_Ascend910B3_float16_232010000.cce
    mul_Ascend910B3_float32_210000000.cce
    mul_Ascend910B3_float32_210010000.cce
    mul_Ascend910B3_float32_223000000.cce
    mul_Ascend910B3_float32_223010000.cce
    mul_Ascend910B3_float32_232000000.cce
    mul_Ascend910B3_float32_232010000.cce
    mul_Ascend910B3_int8_210000000.cce
    mul_Ascend910B3_int8_210010000.cce
    mul_Ascend910B3_int8_223000000.cce
    mul_Ascend910B3_int8_223010000.cce
    mul_Ascend910B3_int8_232000000.cce
    mul_Ascend910B3_int8_232010000.cce
    mul_Ascend910B3_int32_210000000.cce
    mul_Ascend910B3_int32_210010000.cce
    mul_Ascend910B3_int32_223000000.cce
    mul_Ascend910B3_int32_223010000.cce
    mul_Ascend910B3_int32_232000000.cce
    mul_Ascend910B3_int32_232010000.cce
    mul_Ascend910B4_float16_210000000.cce
    mul_Ascend910B4_float16_210010000.cce
    mul_Ascend910B4_float16_223000000.cce
    mul_Ascend910B4_float16_223010000.cce
    mul_Ascend910B4_float16_232000000.cce
    mul_Ascend910B4_float16_232010000.cce
    mul_Ascend910B4_float32_210000000.cce
    mul_Ascend910B4_float32_210010000.cce
    mul_Ascend910B4_float32_223000000.cce
    mul_Ascend910B4_float32_223010000.cce
    mul_Ascend910B4_float32_232000000.cce
    mul_Ascend910B4_float32_232010000.cce
    mul_Ascend910B4_int8_210000000.cce
    mul_Ascend910B4_int8_210010000.cce
    mul_Ascend910B4_int8_223000000.cce
    mul_Ascend910B4_int8_223010000.cce
    mul_Ascend910B4_int8_232000000.cce
    mul_Ascend910B4_int8_232010000.cce
    mul_Ascend910B4_int32_210000000.cce
    mul_Ascend910B4_int32_210010000.cce
    mul_Ascend910B4_int32_223000000.cce
    mul_Ascend910B4_int32_223010000.cce
    mul_Ascend910B4_int32_232000000.cce
    mul_Ascend910B4_int32_232010000.cce
    add_Ascend910b_int64_210000000.cce
    add_Ascend910b_int64_210010000.cce
    add_Ascend910b_int64_2147483647.cce
    max_Ascend910b_int64_210000000.cce
    max_Ascend910b_int64_210010000.cce
    max_Ascend910b_int64_2147483647.cce
    min_Ascend910b_int64_210000000.cce
    min_Ascend910b_int64_210010000.cce
    min_Ascend910b_int64_2147483647.cce
    mul_Ascend910b_int64_210000000.cce
    mul_Ascend910b_int64_210010000.cce
    mul_Ascend910b_int64_2147483647.cce
    MemSet_dynamic_AtomicAddrClean_1_ascend910b.cce
    gatherv2_Ascend910B_float32_B1B2.cce
    gatherv2_Ascend910B_float32_B3B4.cce
    uss_Ascend910B4_float32_770001000.cce
    uss_Ascend910B4_float32_770001001.cce
    uss_Ascend910B4_float32_770002000.cce
    uss_Ascend910B4_float32_770007110.cce
    uss_Ascend910B4_float32_770008110.cce
    uss_Ascend910B4_float32_770016100.cce
    uss_Ascend910B4_float32_770017110.cce
    uss_Ascend910B4_float32_770001100.cce
    uss_Ascend910B4_float32_770011100.cce
    uss_Ascend910B4_float32_770002100.cce
    uss_Ascend910B4_float32_770012100.cce
    uss_Ascend910B4_float32_770018110.cce PROPERTIES LANGUAGE CXX
)

add_library(hccl_reduce_op_ascend910B_obj
    OBJECT mul_Ascend910B1_float16_210000000.cce
    mul_Ascend910B1_float16_210010000.cce
    mul_Ascend910B1_float16_223000000.cce
    mul_Ascend910B1_float16_223010000.cce
    mul_Ascend910B1_float16_232000000.cce
    mul_Ascend910B1_float16_232010000.cce
    mul_Ascend910B1_float32_210000000.cce
    mul_Ascend910B1_float32_210010000.cce
    mul_Ascend910B1_float32_223000000.cce
    mul_Ascend910B1_float32_223010000.cce
    mul_Ascend910B1_float32_232000000.cce
    mul_Ascend910B1_float32_232010000.cce
    mul_Ascend910B1_int8_210000000.cce
    mul_Ascend910B1_int8_210010000.cce
    mul_Ascend910B1_int8_223000000.cce
    mul_Ascend910B1_int8_223010000.cce
    mul_Ascend910B1_int8_232000000.cce
    mul_Ascend910B1_int8_232010000.cce
    mul_Ascend910B1_int32_210000000.cce
    mul_Ascend910B1_int32_210010000.cce
    mul_Ascend910B1_int32_223000000.cce
    mul_Ascend910B1_int32_223010000.cce
    mul_Ascend910B1_int32_232000000.cce
    mul_Ascend910B1_int32_232010000.cce
    mul_Ascend910B2_float16_210000000.cce
    mul_Ascend910B2_float16_210010000.cce
    mul_Ascend910B2_float16_223000000.cce
    mul_Ascend910B2_float16_223010000.cce
    mul_Ascend910B2_float16_232000000.cce
    mul_Ascend910B2_float16_232010000.cce
    mul_Ascend910B2_float32_210000000.cce
    mul_Ascend910B2_float32_210010000.cce
    mul_Ascend910B2_float32_223000000.cce
    mul_Ascend910B2_float32_223010000.cce
    mul_Ascend910B2_float32_232000000.cce
    mul_Ascend910B2_float32_232010000.cce
    mul_Ascend910B2_int8_210000000.cce
    mul_Ascend910B2_int8_210010000.cce
    mul_Ascend910B2_int8_223000000.cce
    mul_Ascend910B2_int8_223010000.cce
    mul_Ascend910B2_int8_232000000.cce
    mul_Ascend910B2_int8_232010000.cce
    mul_Ascend910B2_int32_210000000.cce
    mul_Ascend910B2_int32_210010000.cce
    mul_Ascend910B2_int32_223000000.cce
    mul_Ascend910B2_int32_223010000.cce
    mul_Ascend910B2_int32_232000000.cce
    mul_Ascend910B2_int32_232010000.cce
    mul_Ascend910B3_float16_210000000.cce
    mul_Ascend910B3_float16_210010000.cce
    mul_Ascend910B3_float16_223000000.cce
    mul_Ascend910B3_float16_223010000.cce
    mul_Ascend910B3_float16_232000000.cce
    mul_Ascend910B3_float16_232010000.cce
    mul_Ascend910B3_float32_210000000.cce
    mul_Ascend910B3_float32_210010000.cce
    mul_Ascend910B3_float32_223000000.cce
    mul_Ascend910B3_float32_223010000.cce
    mul_Ascend910B3_float32_232000000.cce
    mul_Ascend910B3_float32_232010000.cce
    mul_Ascend910B3_int8_210000000.cce
    mul_Ascend910B3_int8_210010000.cce
    mul_Ascend910B3_int8_223000000.cce
    mul_Ascend910B3_int8_223010000.cce
    mul_Ascend910B3_int8_232000000.cce
    mul_Ascend910B3_int8_232010000.cce
    mul_Ascend910B3_int32_210000000.cce
    mul_Ascend910B3_int32_210010000.cce
    mul_Ascend910B3_int32_223000000.cce
    mul_Ascend910B3_int32_223010000.cce
    mul_Ascend910B3_int32_232000000.cce
    mul_Ascend910B3_int32_232010000.cce
    mul_Ascend910B4_float16_210000000.cce
    mul_Ascend910B4_float16_210010000.cce
    mul_Ascend910B4_float16_223000000.cce
    mul_Ascend910B4_float16_223010000.cce
    mul_Ascend910B4_float16_232000000.cce
    mul_Ascend910B4_float16_232010000.cce
    mul_Ascend910B4_float32_210000000.cce
    mul_Ascend910B4_float32_210010000.cce
    mul_Ascend910B4_float32_223000000.cce
    mul_Ascend910B4_float32_223010000.cce
    mul_Ascend910B4_float32_232000000.cce
    mul_Ascend910B4_float32_232010000.cce
    mul_Ascend910B4_int8_210000000.cce
    mul_Ascend910B4_int8_210010000.cce
    mul_Ascend910B4_int8_223000000.cce
    mul_Ascend910B4_int8_223010000.cce
    mul_Ascend910B4_int8_232000000.cce
    mul_Ascend910B4_int8_232010000.cce
    mul_Ascend910B4_int32_210000000.cce
    mul_Ascend910B4_int32_210010000.cce
    mul_Ascend910B4_int32_223000000.cce
    mul_Ascend910B4_int32_223010000.cce
    mul_Ascend910B4_int32_232000000.cce
    mul_Ascend910B4_int32_232010000.cce
    add_Ascend910b_int64_210000000.cce
    add_Ascend910b_int64_210010000.cce
    add_Ascend910b_int64_2147483647.cce
    max_Ascend910b_int64_210000000.cce
    max_Ascend910b_int64_210010000.cce
    max_Ascend910b_int64_2147483647.cce
    min_Ascend910b_int64_210000000.cce
    min_Ascend910b_int64_210010000.cce
    min_Ascend910b_int64_2147483647.cce
    mul_Ascend910b_int64_210000000.cce
    mul_Ascend910b_int64_210010000.cce
    mul_Ascend910b_int64_2147483647.cce
    MemSet_dynamic_AtomicAddrClean_1_ascend910b.cce
    gatherv2_Ascend910B_float32_B1B2.cce
    gatherv2_Ascend910B_float32_B3B4.cce
    uss_Ascend910B4_float32_770001000.cce
    uss_Ascend910B4_float32_770001001.cce
    uss_Ascend910B4_float32_770002000.cce
    uss_Ascend910B4_float32_770007110.cce
    uss_Ascend910B4_float32_770008110.cce
    uss_Ascend910B4_float32_770016100.cce
    uss_Ascend910B4_float32_770017110.cce
    uss_Ascend910B4_float32_770018110.cce
    uss_Ascend910B4_float32_770001100.cce
    uss_Ascend910B4_float32_770011100.cce
    uss_Ascend910B4_float32_770002100.cce
    uss_Ascend910B4_float32_770012100.cce
)

target_compile_options(hccl_reduce_op_ascend910B_obj PRIVATE
    -c
    -O2
    --cce-aicore-arch=dav-c220-vec
    --cce-aicore-only
    -Wl,z,now
    -fPIE -pie
    -z now
    -fstack-protector-all
    -mllvm -cce-aicore-addr-transform
)

get_filename_component(CCE_DIR "${CMAKE_LINKER}" PATH)


add_custom_target(hccl_reduce_op_ascend910B
    COMMAND ${CCE_DIR}/ld.lld -m aicorelinux -Ttext 0 $<TARGET_OBJECTS:hccl_reduce_op_ascend910B_obj> -o ${CMAKE_CURRENT_BINARY_DIR}/hccl_reduce_op_ascend910B.o
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
    COMMAND_EXPAND_LISTS
)
add_dependencies(hccl_reduce_op_ascend910B hccl_reduce_op_ascend910B_obj)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/hccl_reduce_op_ascend910B.o OPTIONAL
    DESTINATION ${INSTALL_LIBRARY_DIR}
)
